package com.system.dao;

import com.system.domain.Student;
import java.util.ArrayList;

public class StudentDao implements BaseStuDao{
    private static ArrayList<Student> list = new ArrayList<>();

    static {
        Student student = new Student("001","小李","21","1997-8-20");
        Student studentTwo = new Student("002","小王","23","1991-8-21");
        list.add(student);
        list.add(studentTwo);
    }

    public boolean add(Student student) {
                list.add(student);
                return true;
    }

    public ArrayList<Student> getStuInfo() {
        return list;
    }

    public void delete(int index) {
        list.remove(index);
    }

    public void update(int index, Student student) {
        list.set(index,student);
    }
}
